<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="ar" %>

<logic:notPresent name="AllUsers">
    The list of users is currently not available.
</logic:notPresent>

<html:link styleClass="button" action="/Users/RegistrationForm">Registration form</html:link>

<logic:present name="AllUsers">
    <ar:pager collection="AllUsers" pageSize="10" action="/Users/List"/>
    <table border=0>
        <tr style="background-color: #EEEEEE">
            <td>User id</td>
            <td>Login</td>
            <td>Email</td>
            <td>Name</td>
            <td>Surname</td>
            <td>Actions</td>
        </tr>
        <logic:iterate name="AllUsers" id="User">
            <tr>
            <td>${User.id}</td>
            <td>${User.login}</td>
            <td><a href="mailto:${User.email}">${User.email}</a></td>
            <td>${User.name}</td>
            <td>${User.surname}</td>
            <td>
                <html:link action="/Users/Delete" paramName="User" paramProperty="id" paramId="id">Delete</html:link>
                <html:link action="/Users/Edit" paramName="User" paramProperty="id" paramId="id">Edit</html:link>
                <html:link action="/Users/Details" paramName="User" paramProperty="id" paramId="id">Details</html:link>
            </td>
        </tr>
    </logic:iterate>
    </table>
</logic:present>
